package com.smy.jkds.po;

import java.io.Serializable;
import java.util.List;

/**
 * @author z01140
 * @Package: com.smy.jkds.po
 * @Description:
 * @CreateDate 2021/10/30 15:18
 * @UpdateDate 2021/10/30 15:18
 */
public class Result implements Serializable {

    private final static Long serialVersionUID = -1L;
    private Integer code;//1 = 成功 0=失败
    private String desc;
    private Object data;

    public Result(Integer code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public Result(Integer code, String desc, Object data){
        this.code = code;
        this.desc = desc;
        this.data = data;
    }

    public static Result success(String desc){
        return new Result(1, desc);
    }

    public static Result success(String desc, Object data){
        return new Result(1, desc, data);
    }

    public static Result error(String desc){
        return new Result(0, desc);
    }

    public static Result error(String desc, Object data){
        return new Result(0, desc, data);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
